{include file="public/header" /}
<body>
<div class="layui-tab layui-tab-brief main-tab-container">
    <ul class="layui-tab-title main-tab-title">
        <li class="layui-this">友链修改</li>
        <div class="main-tab-item">内容管理</div>
    </ul>
    <div class="layui-tab-content">
        <form class="layui-form" onsubmit="return false;">
            <input type="hidden" name="id" value="{$link.id}">
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">网站名称</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="text" name="name" value="{$link.name}" lay-verify="required" autocomplete="off" placeholder="请输入网站名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站链接</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="text" name="url" value="{$link.url}" lay-verify="required" autocomplete="off" placeholder="请输入网站链接 需要加http://" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否显示</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="radio" name="status" value="1" title="是" checked=""><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><span>是</span></div>
                        <input type="radio" name="status" value="0" title="否"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><span>否</span></div></div>
                    <div class="layui-form-mid layui-word-aux">
                    </div>
                </div>
                <!--<div class="layui-form-item">-->
                <!--<label class="layui-form-label">发布时间</label>-->
                <!--<div class="layui-input-inline input-custom-width">-->
                <!--<input type="text" name="create_time" value="2017-02-24 21:47:42" id="date" lay-verify="datetime" placeholder="YYYY-MM-DD hh:mm:ss" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this,istime: 1, format: 'YYYY-MM-DD hh:mm:ss' })">-->
                <!--</div>-->
                <!--</div>-->
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="links_add" id="links_add">立即修改</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    //修改操作
    $("#links_add").click(function(){
        $.ajax({
            url: "{:url('links/edit_link')}",
            data: $("form").serialize(),
            type: "POST",
            datatype:"json",
            success: function( result ) {
                layer.open({
                    title: '信息'
                    ,content: '修改成功！'
                });
            }
        });
    });
</script>
<script type="text/javascript">
    layui.use(['element', 'form', 'upload', 'layedit', 'laydate'], function(){
        var element = layui.element()
            ,form = layui.form()
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,jq = layui.jquery;
    })
</script>
</body>
</html>